package com.huanghuai.retail.controller;

import com.huanghuai.retail.common.R;
import com.huanghuai.retail.entity.Device;

import com.huanghuai.retail.service.DeviceService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/device")
public class DeviceController {
    @Resource
    private DeviceService deviceService;
    @PostMapping
    public R<String> saves(@RequestBody Device device){
        return deviceService.saves(device);
    }
    @PutMapping
    public R<String> updates(@RequestBody Device device){
        return deviceService.updates(device);
    }
    @GetMapping("/{id}")
    public R<Device> getByIds(@PathVariable Long id) {
        return deviceService.getByIds(id);
    }
}
